﻿@{
    ViewData["Title"] = "缩略图管理";
    Layout = "~/Areas/Manager/Views/Shared/_Layout.cshtml";
}
<div class="layui-bg">
        <div class="layui-card-body">
            <form class="layui-form">
                <div class="layui-form-item">
                    <div class="layui-col-xs3">
                        <label class="layui-form-label" style="width:100%">系统模块</label>
                    </div>
                    <div class="layui-col-xs6">
                        <select id="Type" name="Type" lay-verify="required">
                            <option value="">请选择模块</option>
                            <option value="0">Shop</option>
                            <option value="1">CMS</option>
                            <option value="2">SNS</option>
                            <option value="3">Property</option>
                            <option value="4">House</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-col-xs3">
                        <label class="layui-form-label" style="width:100%">缩略图标识符</label>
                    </div>
                    <div class="layui-col-xs6">
                        <input type="text" name="ThumName" class="layui-input" lay-verify="required">
                        <span>* 必填，添加之后不可修改！</span>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-col-xs3">
                        <label class="layui-form-label" style="width:100%">宽度</label>
                    </div>
                    <div class="layui-col-xs2">
                        <input type="text" name="ThumWidth" class="layui-input" lay-verify="required">
                    </div>
                    <div class="layui-col-xs2">
                        <label class="layui-form-label" style="width:100%">高度</label>
                    </div>
                    <div class="layui-col-xs2">
                        <input type="text" name="ThumHeight" class="layui-input" lay-verify="required">
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-col-xs3">
                        <label class="layui-form-label" style="width:100%">剪切模式</label>
                    </div>
                    <div class="layui-col-xs6">
                        <select id="ThumMode" name="ThumMode" lay-verify="required">
                            <option value="">请选择剪切模式</option>
                            <option value="HW">指定高宽缩放（补白）</option>
                            <option value="W">指定宽，高按比例</option>
                            <option value="H">指定高，宽按比例</option>
                            <option value="Cut">指定高宽裁减（不变形）</option>
                            <option value="Csize">调整图片大小</option>
                        </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-col-xs3">
                        <label class="layui-form-label" style="width:100%">描述</label>
                    </div>
                    <div class="layui-col-xs6" style="position: relative;">
                        <input type="text" name="Remark" class="layui-input" lay-verify="required">
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-col-xs3">
                    </div>
                    <div class="layui-col-xs6">
                        <button class="layui-btn" lay-submit lay-filter="add" id="submit" type="button">保存</button>
                        <button id="close" type="button" class="layui-btn layui-btn-primary">关闭</button>
                    </div>
                </div>
            </form>
        </div>
</div>
@section scriptsfeet
    {
    <script type="text/javascript">

        layui.config({
            base: '/layuiadmin/' //自定义模块路径
        }).use(['form', 'layer', 'sykjwh'], function () {
            var $ = layui.$, form = layui.form, sykjwh = layui.sykjwh;

            form.on('submit(add)', function (obj) {
                console.log(obj.field);
                //保存
                sykjwh.save('@Url.Action("ThumbnailSizeAdd", "Ms", new { area = Constant.AREAMANAGER })', obj.field);
            });

            $("#close").click(function () {
                sykjwh.close();
            });
        });
    </script>
}
